package org.example.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.example.utils.TimeUtils;
import org.example.vo.InvitationVo;

import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor

public class Invitation {
    @TableId
    public int id;
    public int sender;
    public int receiver;
    public Date createTime;
    public int status;
    public int limitTime;
    public String text;

    public Invitation(InvitationVo i){
        sender = i.getSender();
        receiver = i.getReceiver();
        text = i.getText();
        Date currentTime = TimeUtils.getCurrentTime();
        createTime = currentTime;
        limitTime = 7;
        status = 0;
    }
}
